/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/11/07
*/
#ifndef __EDUI_SDL_CURSOR_H__
#define __EDUI_SDL_CURSOR_H__

#include "SDL.h"
#include "edui/interface/ICursor.h"

EDUI_NAMESPACE_BEGIN

class Cursor : public ICursor
{
protected:
    Cursor();
    virtual ~Cursor();
public:
#ifdef EDUI_TEST_NEW_DELETE
    static int m_newdeleteNum;
    static int _GetNewDeleteNum();
#endif
	static Cursor* GetInterface();
	virtual void Release();
    static Cursor* ToCursor(ICursor* cursor);
public:
    virtual bool Create(const Uint8* data, const Uint8* mask, int w, int h, int hotX, int hotY, const char* name, int id = -1);
    virtual bool Create(ISurface* surface, int hotX, int hotY, const char* name, int id = -1);
    virtual bool Create(SystemCursor sysid, const char* name, int id = -1);

    // create use this function, you must Destroy and Release this cursor.
	virtual bool Create(SDL_Cursor* cursor);

    virtual void Destroy();

    virtual bool IsOK();
public:
	SDL_Cursor* GetSDLCursor() const;
protected:
    SDL_Cursor* m_cursor;
};

EDUI_NAMESPACE_END

#endif